<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .parent{
      width: 300px;
      height: 300px;
      background-color: red;
      position: relative;
    }
    .one{
      width: 100px;
      height: 100px;
      background-color: #333;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%,-50%);
    }
  </style>
</head>
<body>
  
</body>
</html>